package com.Smart.smartscals.HttpTools;

import java.util.List;

import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

import com.Smart.smartscals.Entity.EntityRegist;

public class HttpTools {
	// 注册
	public static final String URLREGISTER = "http://218.24.163.216:18080/eblter/Service1.asmx/UserRegister";
	// 登陆
	public static final String URLLOGIN = "http://218.24.163.216:18080/eblter/Service1.asmx/UserRegister";

	public static final int REQUESTPOST = 1;
	public static final int REQUESRGET = 0;
	
	public static final int HTTPAPIHTTPURL = 0;
	public static final int HTTPAPIHTTPCLIENT = 1;

	
	
	/**
	 * 从网络中获取接口的VersonCode的数据；
	 */
	public static int getVerSionCodeFromeNet() {
		// TODO 自动生成的方法存根

		return 10;
	}

	/**
	 * 判断网络是否可使用(无论是3G，wifi还是)；
	 * 
	 * @return
	 */
	public static boolean isNetWork(Context context) {
		// TODO 自动生成的方法存根

		ConnectivityManager connectivityManager = (ConnectivityManager) context
				.getSystemService(Context.CONNECTIVITY_SERVICE);
		if (connectivityManager == null) {
		} else {
			NetworkInfo[] networkInfos = connectivityManager
					.getAllNetworkInfo();
			if (networkInfos != null) {
				for (int i = 0, count = networkInfos.length; i < count; i++) {
					if (networkInfos[i].getState() == NetworkInfo.State.CONNECTED) {
						return true;
					}
				}
			}
		}
		return false;
	}

	
}
